*************************************************************************
*																		*
*					Campaign Panel Book Chapter 6 - Long Format			*
*																		*
*************************************************************************	

use "${data}\ZA5704_en_v3-2-0.dta", clear

keep lfdn teilnahme n_teilnahmen

cd "${path}\Reproducible Do-Files\Chapter 6\Data"

// Adding the operationalized variables
merge 1:1 lfdn using choice13
drop _merge


merge 1:1 lfdn using events13
drop _merge

merge 1:1 lfdn using komm_variablen13
drop _merge

merge 1:1 lfdn using michigan13
drop _merge


*********************************************************************************
**
** I. Transform into long (panel-)format
**
*********************************************************************************

reshape long wabsa ///
   parta0 parta1 parta4 parta5 parta6 parta7 ///
   nsa_handling1 prob_mittelfinger4 prob_paed6 veggie6 maut1 ///
	syria_handling1  glaubw_rrg4 ///
	wahlarena1 wahlarena4 wahlarenag_mg wahlarenag_sg ///
   tvduell1 tvduell4 tvduell_su1 tvduell_su4 tvduell_md1 tvduell_md4 watcheddebate  ///
   wahlomat1 wahlomat4 wahlomat5 wahlomat6 wahlomat7 wahlomatg ///
   gespr1 gespr4  gespr5 gespr6 gespr7 ///
   pk_gesamtin1 pk_gesamtin4 pk_gesamtin5 pk_gesamtin6 pk_gesamtin7 ///
   koagk koasge koarg koarrg koasgr ///
   regzufr kand1 kand4 kand5 kand6 kand7  ///
   komp1 komp4 komp5 komp6 komp7 ///
   ewl awl bayern5, ///
   i(lfdn) j(welle)
   

**********************************************************
**														**
** 					Wave dummies						**
**														**
**********************************************************


tab welle, gen(w)


**********************************************************
**														**
**					Save								**
**														**
***********************************************************


save "${path}\Reproducible Do-Files\Chapter 6\Data\longformat13.dta", replace


